package com.jxpanda.spring.module.wechat.exception;

import com.jxpanda.spring.module.wechat.constant.WechatAppletType;
import lombok.RequiredArgsConstructor;

/**
 * @author Panda
 */
@RequiredArgsConstructor
public class WechatAppletNotFoundException extends RuntimeException {

    private static final String MESSAGE_TEMPLATE = "未找到微信应用，请检查应用配置是否正确。应用类型：%s，应用名称：%s";

    private final WechatAppletType appletType;

    private final String appName;

    @Override
    public String getMessage() {
        return String.format(MESSAGE_TEMPLATE, appletType.getDescription(), appName);
    }
}
